/**
 * @brief Gets the number of father shell elements for a specific processor
 * 
 * This function provides access to precomputed father shell element counts
 * stored in a distributed array, where each processor's count is stored at
 * its index position.
 */
class FatherShellCounter {
public:
    /**
     * @brief Retrieves the number of father shell elements for a given processor
     * @param elementCounts Array containing counts for all processors
     * @param processorId The processor ID (0-based index)
     * @return int Number of father shell elements for the specified processor
     * 
     * @note The function assumes the input array is properly initialized
     *       and the processorId is within valid bounds. For production code,
     *       additional bounds checking should be added.
     */
    static int getCount(const int* elementCounts, int processorId) {
        return elementCounts[processorId];
    }

    /**
     * @brief Modern C++ version using vector for safer access
     * @param elementCounts Vector containing counts for all processors
     * @param processorId The processor ID (0-based index)
     * @return int Number of father shell elements
     * @throws std::out_of_range if processorId is invalid
     */
    static int getCountSafe(const std::vector<int>& elementCounts, int processorId) {
        if (processorId < 0 || processorId >= static_cast<int>(elementCounts.size())) {
            throw std::out_of_range("Invalid processor ID in getCountSafe");
        }
        return elementCounts[processorId];
    }
};